/**
 * @param {string} s
 * @param {string} p
 * @return {boolean}
 */
var isMatch = function (s, p) {
  let adjust = true
  let lastItem = ''
  let parr = p.split('')
  parr.forEach((item, index) => {
    if (item === '*') {
      if (lastItem === '.') {
        let len = s.length - p.length + 2
        let takeStr = s.slice(index, index + len)
        parr.splice(index - 1, 2, '.')
      } else if (s.charAt(index) === lastItem) {
        item = s.charAt(index)
      } else {
        parr.splice(index, 1)
      }
    }

    if (item !== s.charAt(index)) {
      adjust = false
    }
    lastItem = item
    if (item === '.') {
      lastItem = '.'
    }
  })
  return adjust
}
a.*b.*c
axxxbdasdc
console.log(isMatch('ab', '.*'))
